//
//  MYRequesTool+live.m
//  JQLive
//
//  Created by Bruce on 2020/8/10.
//  Copyright © 2020 mlkq. All rights reserved.
//

#import "MYRequesTool+live.h"

@implementation MYRequesTool (live)

#pragma mark - 直播服务/live-api

/// 获取房间详情 MY_live_room_detail
/// @param param roomId 直播间ID get
/// @param successHandle 成功回调
/// @param failureHandle 失败回调
+ (void)MY_live_room_detail_RequestWithParam:(NSDictionary *)param
                                       successHandle:(void(^)(id response))successHandle
                                       failureHandle:(void(^)(NSError *error))failureHandle{

    [MYHTTPManager  getAFNWithUrl:MY_live_room_detail parameters:param MYServiceModuleType:PublicBaseUrl_Type successHandle:^(NSURLSessionTask * _Nonnull task, id  _Nonnull response) {
        DLog(@"%@",response);

        if ([self requestReslutDelWith:response]) {
            if (successHandle) {
                successHandle(response);
            }
        }
        else
        {
            if (failureHandle) {
                failureHandle(nil);
            }
        }
        
        
    } failureHandle:^(NSURLSessionTask * _Nonnull task, NSError * _Nonnull error) {
        DLog(@"%@",error);

        if (failureHandle) {
            failureHandle(error);
        }
    }];
}
/// 获取直播间列表-APP MY_live_rooms_appList
/// @param param page size roomTagId 房间标签ID get
/// @param successHandle 成功回调
/// @param failureHandle 失败回调
+ (void)MY_live_rooms_appList_RequestWithParam:(NSDictionary *)param
                                       successHandle:(void(^)(id response))successHandle
                                       failureHandle:(void(^)(NSError *error))failureHandle{

    [MYHTTPManager  getAFNWithUrl:MY_live_rooms_appList parameters:param MYServiceModuleType:PublicBaseUrl_Type successHandle:^(NSURLSessionTask * _Nonnull task, id  _Nonnull response) {
        DLog(@"%@",response);

        if ([self requestReslutDelWith:response]) {
            if (successHandle) {
                successHandle(response);
            }
        }
        else
        {
            if (failureHandle) {
                failureHandle(nil);
            }
        }
        
        
    } failureHandle:^(NSURLSessionTask * _Nonnull task, NSError * _Nonnull error) {
        DLog(@"%@",error);

        if (failureHandle) {
            failureHandle(error);
        }
    }];
}
///获取所有房间标签 MY_live_roomtags
/// @param param name 标签名称 get
/// @param successHandle 成功回调
/// @param failureHandle 失败回调
+ (void)MY_live_roomtags_RequestWithParam:(NSDictionary *)param
                                       successHandle:(void(^)(id response))successHandle
                                       failureHandle:(void(^)(NSError *error))failureHandle{

    [MYHTTPManager  getAFNWithUrl:MY_live_roomtags parameters:param MYServiceModuleType:PublicBaseUrl_Type successHandle:^(NSURLSessionTask * _Nonnull task, id  _Nonnull response) {
        DLog(@"%@",response);

        if ([self requestReslutDelWith:response]) {
            if (successHandle) {
                successHandle(response);
            }
        }
        else
        {
            if (failureHandle) {
                failureHandle(nil);
            }
        }
        
        
    } failureHandle:^(NSURLSessionTask * _Nonnull task, NSError * _Nonnull error) {
        DLog(@"%@",error);

        if (failureHandle) {
            failureHandle(error);
        }
    }];
}
/// banner列表 MY_live_banner
/// @param param category banner分类, 1:首页banner 2:娱乐banner  terminal 终端类型, 0:默认 1:ios 2:安卓 3:海外ios 4:web, get
/// @param successHandle 成功回调
/// @param failureHandle 失败回调
+ (void)MY_live_banner_RequestWithParam:(NSDictionary *)param
                                       successHandle:(void(^)(id response))successHandle
                                       failureHandle:(void(^)(NSError *error))failureHandle{

    [MYHTTPManager  getAFNWithUrl:MY_live_banner parameters:param MYServiceModuleType:PublicBaseUrl_Type successHandle:^(NSURLSessionTask * _Nonnull task, id  _Nonnull response) {
        DLog(@"%@",response);

        if ([self requestReslutDelWith:response]) {
            if (successHandle) {
                successHandle(response);
            }
        }
        else
        {
            if (failureHandle) {
                failureHandle(nil);
            }
        }
        
        
    } failureHandle:^(NSURLSessionTask * _Nonnull task, NSError * _Nonnull error) {
        DLog(@"%@",error);

        if (failureHandle) {
            failureHandle(error);
        }
    }];
}


@end
